package univ.uchiha.esiag.gon.operation;

import java.io.Serializable;

import univ.uchiha.esiag.gon.data.DataObject;

public class Operation implements Serializable{
	private static final long serialVersionUID = 1L;
	public static final int CREATE = 0;
	public static final int READ = 1;
	public static final int UPDATE = 2;
	public static final int DELETE = 3;
	public static final int NOTIFY = 4;
	public static final String CACHE = "cache";
	public static final String TOPIC = "topic";
	private int type;
	private boolean replicated;
	private String target;
	private DataObject data;
	public Operation(int type, boolean replicated, String target, DataObject data) {
		this.type = type;
		this.replicated = replicated;
		this.target = target;
		this.data = data;
	}
	public String getTopicNameTarget(){
		return data.getTopicName();
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public boolean isReplicated() {
		return replicated;
	}
	public void setReplicated(boolean replicated) {
		this.replicated = replicated;
	}
	public String getTarget() {
		return target;
	}
	public void setTarget(String target) {
		this.target = target;
	}
	public DataObject getData() {
		return data;
	}
	public void setData(DataObject data) {
		this.data = data;
	}
}
